<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>iframe测试</title>
    <script>
        function f() {
            var url =document.getElementById("url").value;
            document.getElementById("iframe1").src=url;
        }
    </script>
</head>
<body>
<div>
    <p> 请输入地址：</p>
    <p><input type="text" id="url"  >
    <input type="button" value="提交" onclick="f()">
    </p>
</div>
<div>
    <iframe id="iframe1" frameborder="0" style="width: 100%;height: 500px"></iframe>
</div>
</body>
</html>